﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using l1cs.server.model.Instance;

namespace l1cs.server.serverpackets
{
    public class S_UseMap : ServerBasePacket
    {
        private static Logger _log = Logger.getLogger( typeof( S_UseMap ).FullName );

        public S_UseMap( L1PcInstance pc, int objid, int itemid )
        {
            writeC( Opcodes.S_OPCODE_USEMAP );
            writeD( objid );

            switch ( itemid )
            {
                case 40373:
                    writeD( 16 );
                    break;
                case 40374:
                    writeD( 1 );
                    break;
                case 40375:
                    writeD( 2 );
                    break;
                case 40376:
                    writeD( 3 );
                    break;
                case 40377:
                    writeD( 4 );
                    break;
                case 40378:
                    writeD( 5 );
                    break;
                case 40379:
                    writeD( 6 );
                    break;
                case 40380:
                    writeD( 7 );
                    break;
                case 40381:
                    writeD( 8 );
                    break;
                case 40382:
                    writeD( 9 );
                    break;
                case 40383:
                    writeD( 10 );
                    break;
                case 40384:
                    writeD( 11 );
                    break;
                case 40385:
                    writeD( 12 );
                    break;
                case 40386:
                    writeD( 13 );
                    break;
                case 40387:
                    writeD( 14 );
                    break;
                case 40388:
                    writeD( 15 );
                    break;
                case 40389:
                    writeD( 17 );
                    break;
                case 40390:
                    writeD( 18 );
                    break;
            }
        }

        override
        public byte[] getContent()
        {
            return getBytes();
        }

        override
        public String getType()
        {
            return "[S] S_UseMap";
        }
    }
}